﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"   Inherits="System.Web.Mvc.ViewPage<List<CarTrackr.Business.User>>" %>
 

<asp:Content ID="listContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>List of users</h2>
    
    <script type="text/javascript" >

        function unlockComplete(context) {

            alert(context.get_data());

        }

       
    
    </script>
    <ul class="listing">
     
    
    <% foreach (var user in Model) { %>
        <li>
                  <h3>   <%=Html.Encode(user.UserName)%> - <%=Html.Encode(user.Email)%> (<%=Html.Encode(user.OnlineStatus)%>)</h3> 
            
                   <%=Html.ActionLink("Remove", "Remove", "Admin", new { userName = user.UserName }, new { onclick = "return confirm('Remove user, are you sure?');" })%>
                    <%=Ajax.ActionLink("Unlock", "Unlock","Admin", new { userName=user.UserName},new AjaxOptions() { OnComplete="unlockComplete" } ) %>
                 
         
        
        </li>
    <% } %>
    </ul>
 
</asp:Content>
